﻿using LM.Negocio.Objetos;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace LM.Repositorios.Maps
{
    class TabelaPrecoMap : EntityTypeConfiguration<TabelaDePreco>
    {
        public TabelaPrecoMap()
        {
            this.HasKey( m => m.Codigo );
            this.Property( m => m.Id ).HasDatabaseGeneratedOption( DatabaseGeneratedOption.Identity ).HasColumnName( "Id" );
            this.Property( m => m.Codigo ).HasColumnName( "Codigo" ).IsRequired();
            this.Property( m => m.Nome ).HasColumnName( "Nome" ).IsRequired().HasMaxLength( 100 );
            this.Property( m => m.DataInicial ).HasColumnName( "DataInicial" ).IsRequired();
            this.Property( m => m.DataFinal ).HasColumnName( "DataFinal" ).IsRequired();

            this.ToTable( "TABELADEPRECO" );
        }
    }
}
